home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 2 / Apprentice-Release2.iso / Source Code / C / Applications / Eudora 1.3.1 / source / ldef.c < prev    next >
Encoding:
C/C++ Source or Header  |  1993-03-16  |  1.4 KB  |  61 lines  |  [TEXT/MPS ]

  1. #define FILE_NUM 19
  2. /* Copyright (c) 1990-1992 by the University of Illinois Board of Trustees */
  3. #include <Types.h>
  4. #include <Lists.h>
  5. #include <Quickdraw.h>
  6. #include <SysEqu.h>
  7. #include <ToolUtils.h>
  8. void ListDraw(Boolean lSelect,Rect *lRect,Cell lCell,ListHandle lHandle);
  9. /************************************************************************
  10.  * my list definition
  11.  ************************************************************************/
  12. pascal void ListDef(short lMessage, Boolean lSelect, Rect *lRect, Cell lCell,
  13.     short lDataOffset, short lDataLen, ListHandle lHandle)
  14. {
  15. #pragma unused(lDataOffset,lDataLen)
  16.     switch (lMessage)
  17.     {
  18.         case lDrawMsg:
  19.             ListDraw(lSelect,lRect,lCell,lHandle);
  20.             break;
  21.         case lHiliteMsg:
  22.             BitClr((Ptr)HiliteMode, pHiliteBit);
  23.             InvertRect(lRect);
  24.             break;
  25.     }
  26. }
  27.  
  28. void ListDraw(Boolean lSelect,Rect *lRect,Cell lCell,ListHandle lHandle)
  29. {
  30.     Str63 myString;
  31.     short junk=sizeof(myString);
  32.     EraseRect(lRect);
  33.     LGetCell(myString,&junk,lCell,lHandle);
  34.     MoveTo(lRect->left+(*lHandle)->indent.h,lRect->top+(*lHandle)->indent.v);
  35.     DrawString(myString+1);
  36.     if (myString[0])
  37.     {
  38.         Point pt;
  39.         PolyHandle pH;
  40.         
  41.         pt.h = lRect->right - 2;
  42.         pt.v = (lRect->top + lRect->bottom)/2;
  43.         MoveTo(pt.h,pt.v);
  44.         PenNormal();
  45.         if (pH=OpenPoly())
  46.         {
  47.             Line(-4,-4);
  48.             Line(0,9);
  49.             LineTo(pt.h,pt.v);
  50.             ClosePoly();
  51.             PaintPoly(pH);
  52.             KillPoly(pH);
  53.         }
  54.     }
  55.     if (lSelect)
  56.     {
  57.         BitClr((Ptr)HiliteMode, pHiliteBit);
  58.         InvertRect(lRect);
  59.     }
  60. }
  61.